<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>13-剩余参数...</title>
</head>
<body>
    <script>
        var citys = ['西安','兰州','西宁','成都','北京'];
        //配合数据解构使用
        let [c1,c2,...c3] = citys;
        console.log(c1);
        console.log(c2);
        console.log(c3);//[ "西宁", "成都", "北京" ]

        var arr = [1,2,3];
        console.log(...arr);//1 2 3

        //数组合并
        var arr1 = [1,2,3];
        var arr2 = [4,5,6];
        var newArr1 = arr1.concat(arr2);
        console.log(newArr1);
        var newArr2 = [...arr1,...arr2];
        console.log(newArr2);
        var newArr3 = arr1.push(...arr2);
        console.log(newArr3);



    </script>
</body>
</html>